package org.rency.ues.domain.response;

import org.rency.common.utils.domain.BaseResult;
import org.rency.ues.common.UesDict;

import java.util.ArrayList;
import java.util.List;

/**
 * ${todo}
 *
 * @author: Created by user_rcy@163.com on 2016/8/2.
 * @version: V1.0.0
 * @since JDK 1.8
 */
public class DecryptBatchResponse extends BaseResult{

    private List<DecryptResponse> responses;

    public static DecryptBatchResponse success(){
        DecryptBatchResponse resp = new DecryptBatchResponse();
        resp.setSuccess(true);
        resp.setReturnMessage(UesDict.CHINESE_SUCCESS_MSG);
        return resp;
    }

    public static DecryptBatchResponse fail(String returnMessage){
        DecryptBatchResponse resp = new DecryptBatchResponse();
        resp.setSuccess(false);
        resp.setReturnMessage(returnMessage);
        return resp;
    }

    public List<DecryptResponse> getResponses() {
        return responses;
    }

    public void setResponses(List<DecryptResponse> responses) {
        this.responses = responses;
    }

    public void addResponse(DecryptResponse response) {
        if(this.responses == null){
            this.responses = new ArrayList<DecryptResponse>();
        }
        this.responses.add(response);
    }
}
